// pages/remenber/remenber.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   * 
   */

  data: {
    
  },
  onShow(){
    var _this = this
    var i = app.globalData._has_rem_count;
    this.setData({
      src:'http://dict.youdao.com/dictvoice?type=0&audio=' + app.globalData._word_,
    })
    wx.request({
      url: 'http://139.224.115.130/Test_war/selectAllPage',//json数据地址
      headers: {
        'Content-Type': 'application/json'
      },
      success: function (res) {
        //console.log(res.data.imgListData)
        //console.log(res.data.imgListData[0].tag)
        //将获取到的json数据，存在名字叫list_data的这个数组中
        _this.setData({
         
          list_data: res.data.list,
          //res代表success函数的事件对，data是固定的，imgListData是上面json数据中imgListData
          word_index:app.globalData._word_,
          word_mean: app.globalData._word_t,
          word_conmid: app.globalData._word_d,
          word_extend: app.globalData._word_e,
          name: app.globalData._word_p,
          author: "点击获取读音",
          motto: i + "/20",
        })
       
      },
    })
  },
  audioPlay: function () {
    this.audioCtx.play()
  },
  goback(){
    wx.switchTab({
      url:"/pages/index/index"
    })
  },
  rem(){
    if(app.globalData._has_rem_count == 20){
      wx.navigateTo({
        url: '/pages/done/done',
      })
    }
    this.goback();
    app.globalData._has_rem_count++;
  },
  dont_rem(){
    if(app.globalData._has_rem_count == 20){
      wx.navigateTo({
        url: '/pages/done/done',
      })
    }
     this.goback()
     app.globalData._has_rem_count++;
  },

})